package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishFlavorMapper {
    /**
     * 单个添加口味
     *
     * @param dishFlavor
     */
    @Insert("insert into dish_flavor values (null,#{dishId},#{name},#{value})")
    void add(DishFlavor dishFlavor);

    /**
     * 批量添加口味
     *
     * @param dishFlavorList
     */
    void add2(List<DishFlavor> dishFlavorList);

    /**
     * 根据id删除口味
     *
     * @param ids
     */
    void delete(List<Long> ids);

    /**
     * 根据菜品id查询口味
     * @param dishId
     * @return
     */
    @Select("select * from dish_flavor where dish_id = #{dishId}")
    List<DishFlavor> findById(Long dishId);
}
